package com.itdct.onflow.system.common.base

import com.itdct.onflow.core.context.BaseContext
import com.itdct.onflow.core.context.ContextHolder
import com.itdct.onflow.core.controller.BaseController
import com.itdct.onflow.core.exception.CommonException
import com.itdct.onflow.system.account.entity.SysAccountEntity
import com.itdct.onflow.system.common.context.Context

/**
 * @author Zhouwx
 * @date 2025/7/22 23:46:23
 * @version 1.0
 * @description
 */
class BaseSysController: BaseController<SysAccountEntity, LoginDTO>() {
    override fun getContext(): Context {
        val context = ContextHolder.getContext<SysAccountEntity, LoginDTO>()
        if (context == null) {
            throw CommonException("无法找到上下文")
        }
        return context as Context
    }
}